<template>
  <div>
    <z-space vertical>
      <h3>输入input自动添加格式 </h3>
      <div>{{models}}</div>

      <input type="tel" v-facade="'(###) ### - ####'"
             @input="onChange('phone', $event)">


      <h3>银行号</h3>
      <z-facade-input v-model="models.some"
                      mask="#### #### #### ####"></z-facade-input>


<!--      <h3>身份证号</h3>-->
<!--      <z-facade-input v-model="models.id"-->
<!--                      :mask="['### ### #### #### ####', '### ### #### #### ###A']"></z-facade-input>-->

    </z-space>
  </div>
</template>

<script>

export default {
  components: {},
  data() {
    return {
      models: {
        some: '',
        phone: ''
      },
    }
  },
  methods: {
    onChange(path, e) {
      this.$set(this.models, path,  e.target.unmaskedValue)
      console.log('onChange', e)
    },
  }
}
</script>
